package ControlLayer;
import DBLayer.*;
import ModelLayer.*;

import java.util.ArrayList;
public class SaleLineItemCtr 
{
	private SaleLineItem sli;
	private IFDBSaleLineItem ifso;

	public SaleLineItemCtr()
	{
		ifso = new DBSaleLineItem();
	}	
	public int createSaleLineItem(int itemId, int quantity, int saleOrderId)
	{
		SaleLineItem sli = new SaleLineItem(itemId, quantity, saleOrderId);
		return ifso.insertSaleLineItem(sli, false);
	}
	public SaleLineItem findSaleOrderId(int saleOrderId)
    {
        return ifso.findSaleOrderId(saleOrderId, false);
    }
	
	public SaleLineItem findItemId(int itemId)
	{
		return ifso.findItemId(itemId, false);
	}
	
	public int deleteSaleLineItem(int saleOrderId)
    {
        return ifso.deleteSaleLineItem(saleOrderId);
    }
}